﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using ControleRepresentanteSync.Application.Pedido;
using ControleRepresentanteSync.ControleRepresentanteServices;

namespace ControleRepresentanteSync.View.Pedido
{
    class AttributeListViewModel : ViewModelBase, IAttributeListViewModel
    {
        private readonly ObservableCollection<IAttributeItem> m_Attributes;

        public AttributeListViewModel()
        {
            m_Attributes = new ObservableCollection<IAttributeItem>();
        }

        public IList<IAttributeItem> Attributes
        {
            get { return m_Attributes; }
        }

        public AttributeValueContract[] GetAttributeValues()
        {
            AttributeValuesEventArgs attributeValuesEventArgs = new AttributeValuesEventArgs();
            if (GetAttributeValuesRequested != null)
                GetAttributeValuesRequested(this, attributeValuesEventArgs);
            return attributeValuesEventArgs.AttributeValues;

        }

        public event EventHandler<AttributeValuesEventArgs> GetAttributeValuesRequested;
    }
}
